package com.cdeledu.thread.chapter8;import java.util.concurrent.CountDownLatch;/** * 实现了join的功能，并且比join的功能更多。 * @author tengfei.fangtf */public class CountDownLatchTest {    static CountDownLatch c = new CountDownLatch(2);    public static void main(String[] args) throws InterruptedException {        new Thread(new Runnable() {            @Override            public void run() {                System.out.println(1);                c.countDown();                System.out.println(2);                c.countDown();            }        }).start();        c.await();        System.out.println("3");    }}